"""authot:
   data:
"""

import time
# 注释：  跟主程序代码无关，起到说明作用
# 单行注释
'''
  这是
  多行
  注释
'''

"""
  这是多行注释
  2
"""

# 这是输出
# print("hello world!")  ctrl + /
# 多行注释  选中行数  ctrl + /
# print("hello world 2")
# print("hello world 3")

# python用缩进区分代码块，一般使用4个空格
# s = 100
# if s >90:
#     print("成绩优秀")
# else:
#     print("再接再厉")

# js用{} 来区分代码块
# if(i<10) {
#   console.log(i)
# }

# 输出print
# python2 也支持python3的语法
# print "hello world"
# python3
# print("hello world")
#
# #直接输出
# name = "wen"
# age = 18
# print(name,age)
# #指定分割符
# print(name,age, sep="%")
# #指定追加符
# print(name,age,sep="%",end="**")
# #追加到文件
# #生成一个文件对象
# f = open("aa.txt","w+")
# print(name,age, sep = "%", end="**", file = f)
# 实现进度条

# for _ in range(20):
#     print('#', end="")
#     time.sleep(0.5)

# 内建函数
# import getpass
# username = input("please input your name:")
# # password = input("please input your password:")
# #设置一下密码隐藏
# password = getpass.getpass("please input your password:")
#
# print("************************")
# print("用户名:",username)
# print("密码:",password)
# print("密码类型:",type(password))
# print("用户名长度:",len(username))

# 小练习
# s1=int(input("请输入数字1"))
# s2= int(input("请输入数字2"))
# print(s1+s2)

# num1 = input("please input the firsrt number:")
# num2 = input("please input the second number:")
# sum = int(num1)+int(num2)
# print("The sum of these two Numbers:",sum)

# num1 = int(input("please enter any decimal number:"))
# # num2 = int(num1)
# num_bin = bin(int(num1))
# num_oct = oct(int(num1))
# num_hex = hex(int(num1))
# print("其二进制为:",num_bin)
# print("其八进制为：",num_oct)
# print("其十六进制为:",num_hex)

#内置模块：不需要安装的，可以直接导入的  getpass time
#第三方模块： 需要安装，之后才可以导入的  requests
#内置函数：不需要import  直接可以使用的函数 print input type id help  dir int bin oct hex

#import time
# from time import sleep
# print("xxxxxxxxxxxx")
# #time.sleep(1)
# sleep(1)
# print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
#
#######################################################################
#str
#str  count属性
# a = "23ksdifwen2309sdfa.w2e0f"
# # a = 11
# for i in a:
#     print(i,"出现了",a.count(i),"次")

#字符串常用方法
# my_str= "This Is TEST!"
# my_title = "This is My Title"
# my_num = "123"
# my_num2 = "一二三四"
# my_str2 = "hello"
# my_str3 = "hello123"

###########判断系列################
# print("判断数字:",my_num.isdigit())
# print("判断数字:",my_num.isnumeric())
# print("判断数字:",my_num2.isdigit())
# print("判断数字:",my_num2.isnumeric())
#
# print("判断字母:",my_str.isalpha())
# print("判断字母数字:",my_str3.isalnum() )
# print("判断字符串是否以This开始:",my_title.startswith("This"))
# print("判断字符串是否以This结束:",my_title.endswith("This"))
############### 查找统计类##################
# my_str= "This is TEST!"
# print("长度：",len(my_str))
# print("i 第一次出现的位置", my_str.index("i"))
# print("i 第一次出现的位置", my_str.find("i"))
# print("i 出现的次数",my_str.count("i"))
# #########
# #index 没有找到就报错
# #find  没有找到就返回-1
# # print("y 第一次出现的位置", my_str.index("y"))
# print("y 第一次出现的位置", my_str.find("y"))

##################字符串转换类#####################
# msg = "hEllo World Wen   "
#
# print("大写:",msg.upper())
# print("小写:",msg.lower())
# print("标题:",msg.title())
# msg2 = "root:x:0:0:root:/root:/bin/bash"
# print("切割:",msg2.split(":"))
# msg3 = msg2.split(":")
# print("拼接:","#".join(msg3))
# print("去除收尾空白",msg.strip(),"#####")
# print("去除root首尾:",msg2.strip("root"))
# print("字符串填充:",msg.zfill(40))
# print("字符串替换:",msg2.replace(":","%"))
# print("整个字符串首字母大写:",msg.capitalize())
# msg4 = "xxx"
# print(msg4.center(50,'-'))
# print(msg4.ljust(50,"-"))
# print(msg4.rjust(50,"-"))

#小练习#######################################
s = "i,am,lilei"
print("分隔符修改",s.replace(","," "))
print("取出最后一个单词",s[5:])
print(s.replace("i,am,",""))
print("全转化为大写",s.upper())
print("全转化为小写",s.lower())